﻿using Sherwood;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace Sherwood.Tests
{
    
    
    /// <summary>
    ///This is a test class for DependencyInjectionContainerTest and is intended
    ///to contain all DependencyInjectionContainerTest Unit Tests
    ///The dependency injection container should:
    /// * Always return a value when .Current is called
    ///</summary>
    [TestClass()]
    public class DependencyInjectionTests
    {
        
        /// <summary>
        ///Test that DependencyInjection.Container returns a non-null value
        ///</summary>
        [TestMethod()]
        public void Container_Is_Not_Null_Test()
        {
            Microsoft.Practices.Unity.IUnityContainer actual = Sherwood.DependencyInjection.Container;
            Assert.IsNotNull(actual, "DependencyInjectionContainer.Current should not be null.");
        }

        /// <summary>
        /// Test that the resolve method works (object successfully resolved).
        /// </summary>
        [TestMethod]
        public void Object_Could_Be_Resolved_Test()
        {
            ITestType obj = Sherwood.DependencyInjection.Resolve<ITestType>();
            Assert.IsNotNull(obj);
        }
    }
}
